class LoveQuote {
  final int? id;
  final String content;
  final String? category;
  final String? language;
  final String? moodTags;
  final int? usageCount;
  final int? isActive;
  final String? createdBy;
  final int? createdAt;

  LoveQuote({
    this.id,
    required this.content,
    this.category,
    this.language,
    this.moodTags,
    this.usageCount,
    this.isActive,
    this.createdBy,
    this.createdAt,
  });

  factory LoveQuote.fromJson(Map<String, dynamic> json) {
    return LoveQuote(
      id: json['id'],
      content: json['content'],
      category: json['category'],
      language: json['language'],
      moodTags: json['moodTags'],
      usageCount: json['usageCount'],
      isActive: json['isActive'],
      createdBy: json['createdBy'],
      createdAt: json['createdAt'],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      if (id != null) 'id': id,
      'content': content,
      if (category != null) 'category': category,
      if (language != null) 'language': language,
      if (moodTags != null) 'moodTags': moodTags,
      if (usageCount != null) 'usageCount': usageCount,
      if (isActive != null) 'isActive': isActive,
      if (createdBy != null) 'createdBy': createdBy,
      if (createdAt != null) 'createdAt': createdAt,
    };
  }

  LoveQuote copyWith({
    int? id,
    String? content,
    String? category,
    String? language,
    String? moodTags,
    int? usageCount,
    int? isActive,
    String? createdBy,
    int? createdAt,
  }) {
    return LoveQuote(
      id: id ?? this.id,
      content: content ?? this.content,
      category: category ?? this.category,
      language: language ?? this.language,
      moodTags: moodTags ?? this.moodTags,
      usageCount: usageCount ?? this.usageCount,
      isActive: isActive ?? this.isActive,
      createdBy: createdBy ?? this.createdBy,
      createdAt: createdAt ?? this.createdAt,
    );
  }

  @override
  String toString() {
    return 'LoveQuote{id: $id, content: $content, category: $category}';
  }

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is LoveQuote &&
          runtimeType == other.runtimeType &&
          id == other.id &&
          content == other.content;

  @override
  int get hashCode => id.hashCode ^ content.hashCode;
}